package com.s.core.root.strategy.factor.pic.combination;

import com.s.core.root.data._AllData;
import com.s.core.root.data._PicN;
import com.s.core.root.strategy.base.Factor;
import com.s.core.root.strategy.base.Feature;
import com.s.core.root.strategy.factor.point.F_Point_Last;
import com.s.core.root.strategy.factor.point.F_Point_Max;
import com.s.core.root.strategy.factor.point.F_Point_Strong;
import lombok.AllArgsConstructor;

/**
 * Pic特征：描述是最后一个Point是Strong且Max的Pic
 */
@AllArgsConstructor
public class F_Pic_LastMaxStrong implements Factor, Feature {

    @Override
    public void process(_AllData allData) {
        for (_PicN picN : allData.picNMap.values()) {
            if (picN.getPointNList1().stream().anyMatch(pointN ->
                    pointN.containFeature(F_Point_Last.class) &&
                            pointN.containFeature(F_Point_Max.class) &&
                            pointN.containFeature(F_Point_Strong.class))) {
                picN.addFeature(new F_Pic_LastMaxStrong());
            }
        }
    }
}
